home *** CD-ROM | disk | FTP | other *** search
- /* rewind.h vers 0.9
- defines istream manipulator rewind
- that "rewinds" input stream to
- beginning of file and clear state
- (to reset eof flag)
-
- copyright 1994 Paul Hepworth
-
- Permission is granted for everyone
- to include this code in his/her
- programs without restriction.
- */
- #if !defined __REWIND_H
- #define __REWIND_H
-
- #if !defined __IOSTREAM_H
- #include <<iostream.h>>
- #endif
-
- class rewind_type
- {
- friend istream& operator>>>>(istream& is,
- const rewind_type);
- };
-
- const static rewind_type rewind;
-
- inline istream& operator>>>>(istream& is,
- const rewind_type)
- {
- is.seekg(0);
- is.clear();
- return is;
- }
- #endif
-
-